package pl.s7n.paint;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Font;

import pl.s7n.paint.utils.Utils;

/**
 * Keeps the basic information about drawing tool: type, stroke, color and font.
 * 
 * @author 7
 */
public class DrawingToolInfo implements Cloneable {

  DrawingTools tool;
  BasicStroke  stroke;
  Color        color;
  Font         font;

  public DrawingToolInfo() {}

  public DrawingToolInfo(DrawingTools tool, BasicStroke stroke, Color color, Font font) {
    super();
    this.stroke = stroke;
    this.color = color;
    this.font = font;
  }

  /**
   * DrawingInfoTool has to be cloneable in order to be used as memento snapshots.
   */
  @Override
  public DrawingToolInfo clone() {
    return new DrawingToolInfo(tool, // tool is unmodifiable
        Utils.cloneStroke(stroke), // clone stroke
        color, font); // color & font are unmodifiable as well
  }

  public DrawingTools getTool() {
    return tool;
  }

  public void setTool(DrawingTools tool) {
    this.tool = tool;
  }

  public BasicStroke getStroke() {
    return stroke;
  }

  public void setStroke(BasicStroke stroke) {
    this.stroke = stroke;
  }

  public Color getColor() {
    return color;
  }

  public void setColor(Color color) {
    this.color = color;
  }

  public Font getFont() {
    return font;
  }

  public void setFont(Font font) {
    this.font = font;
  }

}
